<template>
  <div class="hzy_view">
    <el-dialog
      title="商品信息"
      :visible.sync="dialogVisible"
      width="1300px"
      :before-close="handleClose"
    >
      <span>
        <el-descriptions
          class="margin-top"
          title="商品查询"
          :column="6"
          :size="size"
          border
        >
          <el-descriptions-item>
            <template slot="label">行号</template>
            {{ viewList.goodsId }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">状态</template>
            {{ viewList.status }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">单据编号</template>
            {{ viewList.documentNum }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">创单日期</template>
            {{ viewList.createDate }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">出库门店</template>
            {{ viewList.outboundStore }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">出库柜台</template>
            {{ viewList.outboundCounter }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">入库门店</template>
            {{ viewList.inboundStore }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">入库柜台</template>
            {{ viewList.inboundcounter }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">商品类型</template>
            {{ viewList.category }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">数量</template>
            {{ viewList.count }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">重量</template>
            {{ viewList.totalWeight }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">成本</template>
            {{ viewList.totalPrice }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">系数</template>
            {{ viewList.series }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">标签金额</template>
            {{ viewList.LabelTotalPrice }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">创单人</template>
            {{ viewList.createPerson }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">审批人</template>
            {{ viewList.approver }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">审批日期</template>
            {{ viewList.approvalDate }}
          </el-descriptions-item>
        </el-descriptions>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "ViewAllocateInfo",
  props: ["isShowViewAllocateInfo", "viewList"],
  mounted() {
    this.dialogVisible = this.isShowViewAllocateInfo;
  },
  watch: {
    dialogVisible: function () {
      if (!this.dialogVisible) {
        this.$emit("closeDialog");
      }
    },
  },
  data() {
    return {
      size: "",
      dialogVisible: false,
    };
  },
  methods: {
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then(() => {
          done();
        })
        .catch(() => {});
    },
    viewInfo() {
      this.$emit("searchClick");
      this.dialogVisible = true;
    },
  },
};
</script>